﻿using MediatR;
using Medical.Api.Read.Application.Command.BasicManagement.ShelfDictionaryCommand;
using Medical.Api.Read.Service.BasicManagement;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Medical.Api.Read.Application.Handler.BasicManagement.ShelfDictionaryHandler
{
    /// <summary>
    /// 获取货架List解决
    /// </summary>
    public class GetShelvesListHandler : IRequestHandler<GetShelvesListCommand, List<ShelvesListDto>>
    {
        private readonly IBasicManagementService _service;
        public GetShelvesListHandler(IBasicManagementService service)
        {
            _service = service;
        }
        public async Task<List<ShelvesListDto>> Handle(GetShelvesListCommand request, CancellationToken cancellationToken)
        {
            return await _service.GetShelvesListAsync();
        }
    }
}
